package Function_Study.comprehensive;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;

public class Test1 {
    public static void main(String[] args) {
        /*
            练习1:
                集合中存储一些字符串的数据,比如张三,23.
                收集到Student类型的数组当中(使用方法引用完成)
         */

        ArrayList<String> list = new ArrayList<>();
        Collections.addAll(list, "雏鹤爱,12", "樱岛麻衣,16", "小鸟游六花,14", "时崎狂三,18", "四糸乃,11", "夜刀神十香,19");

        Student[] students = list.stream().map(Student::new).toArray(Student[]::new);
        System.out.println(Arrays.toString(students));
    }
}
